<?php
/**
 * Created by PhpStorm.
 * User: aron
 * Date: 2019/6/11
 * Time: 3:41 PM
 */

$phpCode = "<?php echo 'hh'?>";
echo "hh";
$result = $phpCode;
echo "result = {$result}";

class InnerFunctionTestClass {
    private function pFunc() {
        preg_replace_callback("a", $this->replaceCall, "Aa");
    }

    private function replaceCall(array $matches) {
        return "B";
    }

    public function test() {
        $this->pFunc();
    }
}

$obj = new InnerFunctionTestClass();
$obj->test();